package cn.com.dhcc.app.pub.module.codetable.dao.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.util.StringUtils;

import cn.com.dhcc.app.core.component.db.WappedResultSet;
import cn.com.dhcc.app.pub.module.codetable.vo.CodeTable;

public class CodeTableWapper implements RowMapper<CodeTable>{

	@Override
	public CodeTable mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		CodeTable codeTable = new CodeTable();
		codeTable.setType(StringUtils.hasLength(rs.getString("TYPE"))?rs.getString("TYPE").trim().toUpperCase():"");
		codeTable.setCode(StringUtils.hasLength(rs.getString("CODE"))?rs.getString("CODE").trim():"");
		codeTable.setName(rs.getString("NAME"));
		codeTable.setIsuse(rs.getString("ISUSE"));
		codeTable.setSortId(rs.getInt("SORTID"));
		return codeTable;
	}

}
